package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.supplier.execution.PurchasePushDto;
import com.utooo.pojo.dto.suppliermanage.PushSampleDto;
import com.utooo.pojo.dto.suppliermanage.PushSurveyDto;
import com.utooo.service.supplier.SupplierManageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 供应商门户
 * @Author SJD
 * @Date: 2025/4/28 14:28
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "供应商管理-采样推送")
@RequestMapping("suppliermanage")
@RestController
@RequiredArgsConstructor
public class SupplierManageController {

    private final SupplierManageService supplierManageServiceImpl;
    @RequestMapping(value = "/pushSample", method = RequestMethod.POST)
    @Operation(summary = "供货商推送采样到供货商管理系统")
    @ResponseBody
    public RestResult<Boolean> pushSample(@RequestBody @Validated(CreateGroup.class) PushSampleDto parm) {
        Boolean result = supplierManageServiceImpl.pushSample(parm);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }

    @RequestMapping(value = "/pushSurvey", method = RequestMethod.POST)
    @Operation(summary = "供货商推送调查到供货商管理系统")
    @ResponseBody
    public RestResult<Boolean> pushSurvey(@RequestBody @Validated(CreateGroup.class) PushSurveyDto param) {
        Boolean result = supplierManageServiceImpl.pushSurvey(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }
}
